package com.lihao.wanandroid.ui.main

import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import androidx.navigation.Navigation
import com.lihao.wanandroid.R
import com.lihao.wanandroid.app.base.BaseActivity
import com.lihao.wanandroid.app.util.SettingUtil
import com.lihao.wanandroid.app.util.StatusBarUtil

class MainActivity : BaseActivity<MainViewModel>() {

    override fun layoutId() = R.layout.activity_main

    override fun initView(savedInstanceState: Bundle?) {
        supportActionBar?.setBackgroundDrawable(ColorDrawable(SettingUtil.getColor(this, R.color.white)))
        StatusBarUtil.setColor(this, SettingUtil.getColor(this, R.color.white), 0)
        StatusBarUtil.setLightMode(this)
    }

    override fun onSupportNavigateUp(): Boolean {
        return Navigation.findNavController(this, R.id.hostFragment).navigateUp()
    }
}
